﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Bookkeeping.Core.Entities;

namespace Bookkeeping.Web.UserControls
{
    public partial class PostControl : System.Web.UI.UserControl
    {
        public Post Post { get; set; }

        protected string Name
        {
            get
            {
                return Server.HtmlEncode(Post.Name);
            }
        }

        protected string Description
        {
            get
            {
                return Server.HtmlEncode(Post.Comment);
            }
        }

        protected string Amount
        {
            get
            {
                return Post.Amount.ToString();
            }
        }

        public bool IsAlternateRow { get; set; }

        protected void Page_Load(object sender, EventArgs e)
        {
            CssHelper.AdjustClassForAmount(amountDiv, Post.Amount);
        }
    }
}